package com.yanqu.road.logic.activity.hotpotjump.game.choose;

import com.yanqu.road.entity.autodata.hotpotjump.HotpotJumpUnit;
import com.yanqu.road.logic.activity.hotpotjump.game.JumpBoardGrid;
import com.yanqu.road.logic.activity.hotpotjump.game.eJumpDirection;

import java.util.ArrayList;
import java.util.List;

/**
 * 7 被跳跃攻击击杀的敌人所在点
 */
public class HotpotJumpSkillChoose7 extends HotpotJumpSkillChoose {
    @Override
    public List<List<JumpBoardGrid>> chooseGrid() {
        List<List<JumpBoardGrid>> result = new ArrayList<>();

        List<JumpBoardGrid> chooseGrids = new ArrayList<>();
        for (JumpBoardGrid pathUnitGrid : gameLogic.getPathUnitGrids()) {
            HotpotJumpUnit unitByGrid = gameLogic.findUnitByGrid(pathUnitGrid);
            if (unitByGrid == null) {
                continue;
            }
            if (unitByGrid.isDead()) {
                chooseGrids.add(pathUnitGrid);
            }
        }

        for (JumpBoardGrid grid : chooseGrids) {
            List<JumpBoardGrid> grids = gameLogic.calcRangeGrids(grid, skillRange, eJumpDirection.None);
            result.add(grids);
        }

        return result;
    }
}
